package com.loe.test

import com.google.gson.Gson
import com.loe.json_ext.create
import com.loe.json_ext.toJsonString
import java.util.*
import kotlin.reflect.KClass

fun main()
{
    println(Long::class.javaPrimitiveType == null)
    val t = System.currentTimeMillis()
    for(i in 0..10000000)
    {
        val a = Long::class.javaPrimitiveType == null
    }
    println((System.currentTimeMillis() - t)/ 1000.0)


//    val o = User::class.java.create()
//    val o = Gson().fromJson("{}",User::class.java)
//    o
}

class Sb
{
    private var name = ""
}

data class User(
    val name: String,
    val age: Int,
    val sex: Boolean = true,
    val sb: Sb?
)

private fun isBean(cls: KClass<*>): Boolean
{
    return when (cls)
    {
        String::class,
        Int::class,
        Long::class,
        Boolean::class,
        Double::class,
        Float::class -> false
        else -> true
    }
}